/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package threads;

/**
 *
 * @author Bertil
 * Extensions for thread
 */
public class XThread extends Thread{
    public static boolean delay(long millis){ // En ersättare för sleep() som automatiskt tar hand om InterrupteExceptions
        if(interrupted()){
            return false;
        }
        try{
            sleep(millis);
        }
        catch(InterruptedException e){
            return false;
        }
        return true;
    }
}
